package com.gaogzhen.intro.commonMethod;

import lombok.extern.slf4j.Slf4j;

import java.util.concurrent.TimeUnit;

@Slf4j(topic = "cm.test01")
public class CMSleep {
    public static void main(String[] args) throws InterruptedException {
        Thread t1 = new Thread(() -> {
            while (true) {
                try {
                    Thread.sleep(1000);
                    log.debug("t1 线程执行...");
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        });
        t1.start();
        while (true) {
            TimeUnit.SECONDS.sleep(1);
            log.debug("主线程执行...");
        }
    }
}
